import request from "../../utils/request";

const BASE_URL = "maimao_info/info/coupon";
export default {

    /**
     * 当前用户的店铺发放的优惠券
     */
    shopCouponData(searchData, page, size) {
        return request({
            url: `${BASE_URL}/shopCoupon?page=${page}&size=${size}`,
            method: 'post',
            data: searchData
        })
    },
    add(coupon) {
        return request({
            url: `${BASE_URL}/shop/addCoupon`,
            method: 'post',
            data: coupon
        })
    },
    update(coupon) {
        return request({
            url: `${BASE_URL}/shop/updateCoupon`,
            method: 'post',
            data: coupon
        })
    },
    updateDeleted(id, deleted) {
        return request({
            url: `${BASE_URL}/update/deleted`,
            method: 'post',
            data: {
                id: id + "",
                deleted,
            }
        })
    },
    take(couponId) {
        return request({
            url: `${BASE_URL}/take`,
            method: 'post',
            data: {
                id:couponId
            }
        })
    }


}

